#include<iostream>
#include<cstring>
using namespace std;
char ans[32];
int n,m,i;
int main(){
    scanf("%d",&n);
    while (n--)
    {
        scanf("%d",&m);
        memset(ans,'0',sizeof(ans));
        for ( i = 31; m,i>=0; i--)
        {
            ans[i]+=m&1;
            m>>=1;
        }
        puts(ans);
    }
    return 0;
}